import mongoose from '../dbHelper';
import {defaultSchemaExtend, defaultSchemaOptions} from "../config/index";

const Schema = mongoose.Schema;

const DlyAdminLinkSchema = new Schema(Object.assign({
    clicks: { // 点击次数
        type: Number,
        default: 0
    },
    placeOrder: { // 下单人数
        type: Number,
        default: 0
    },
    orderAmount: { // 下单金额
        type: Number,
        default: 0
    },
    identification: {
        type: String,
        default: ''
    }, //标识
    adminUserId: { // 创建人
        type: Schema.Types.ObjectId,
        ref: 'DlyAdminUser',
        required: true
    },
    status: { // 状态
        type: Number,
        default: 1 //0禁用 1启用
    },
 
}, defaultSchemaExtend), defaultSchemaOptions);

const DlyAdminLink = mongoose.model('DlyAdminLink', DlyAdminLinkSchema, 'DlyAdminLinks');

export default DlyAdminLink